flowchart TD
  subgraph sg0["Main Function"]
    direction TB
    n6["Final Processing"]
    n7["Return Result"]
    subgraph sg1["Initialization"]
      direction TB
      subgraph sg2["Processing Loop"]
        direction TB
        subgraph sg3["Markdown Header tester"]
          direction TB
          n0["Item Analysis"]
          subgraph sg4["Validation"]
            direction TB
            n1{"Validation"}
            class n1 decisionNode;
            n4["False other branch"]
            subgraph sg5["Markdown Header tester in statement"]
              direction TB
              n2["another header in the statement"]
              n3["True totally"]
            end
          end
          subgraph sg6["very useful header"]
            direction TB
            n5["Result"]
          end
        end
      end
    end
  end
  subgraph sg7["Loop Processing"]
    direction TB
    n10["Final Result"]
    subgraph sg8["Main Loop"]
      direction TB
      n8["Item Processing"]
      n9["Accumulation"]
    end
  end
  n2 --> n3
  n1 --> n2
  n1 --> n4
  n0 --> n1
  n3 --> n5
  n4 --> n5
  n5 --> n6
  n6 --> n7
  n9 --> n10
  n8 --> n9
%%__BAML_SPANMAP__={"n0":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":13,"start":8,"end_line":13,"end":27},"n1":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":16,"start":8,"end_line":16,"end":24},"n2":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":22,"start":12,"end_line":22,"end":49},"n3":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":25,"start":12,"end_line":25,"end":30},"n4":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":28,"start":12,"end_line":28,"end":36},"n5":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":35,"start":8,"end_line":35,"end":20},"n6":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":39,"start":4,"end_line":39,"end":24},"n7":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":42,"start":4,"end_line":42,"end":21},"n8":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":53,"start":8,"end_line":53,"end":29},"n9":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":56,"start":8,"end_line":56,"end":26},"n10":{"file_path":"tests/validation_files/headers/complex_headers_test.baml","start_line":62,"start":4,"end_line":62,"end":21}}
  click n0 call bamlMermaidNodeClick() "Go to source"
  click n1 call bamlMermaidNodeClick() "Go to source"
  click n2 call bamlMermaidNodeClick() "Go to source"
  click n3 call bamlMermaidNodeClick() "Go to source"
  click n4 call bamlMermaidNodeClick() "Go to source"
  click n5 call bamlMermaidNodeClick() "Go to source"
  click n6 call bamlMermaidNodeClick() "Go to source"
  click n7 call bamlMermaidNodeClick() "Go to source"
  click n8 call bamlMermaidNodeClick() "Go to source"
  click n9 call bamlMermaidNodeClick() "Go to source"
  click n10 call bamlMermaidNodeClick() "Go to source"